<%--
  -	Date: 2012-05-08
  -
  - Copyright (C) 2012 Jawa Software. All rights reserved.
  - 
  - 服务器管理端登录页面。
--%>
<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="org.jawa.util.JawaGlobals"%>
<%@ page import="org.jawa.JawaServer"%>
<jsp:useBean id="webManager" class="org.jawa.util.WebManager"  />
<% webManager.init(request, response, session, application, out); %>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title><%=webManager.getAppName()%> : 管理登录</title>
		<meta charset="utf-8">
		<link rel="stylesheet" type="text/css" href="<%=path%>/styles/global.css">
		<script src="<%=path%>/scripts/jquery.js"></script>
	</head>
	<body>
		<div class="row-fluid">
			<form action="<%=path%>/adminLogin" method="post" name="loginform"
				id="loginform" class="well form-horizontal">
				<div class="control-group">
					<label class="control-label" for="propNameId">
						用户名:
					</label>
					<div class="controls">
						<input id="j_username" name="j_username" type="text"
							class="input-xlarge focused" maxlength="10" value="" tabindex="1"
							placeholder="请输入用户名" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="propNameId">
						密码:
					</label>
					<div class="controls">
						<input id="j_password" name="j_password" type="password"
							class="input-xlarge focused" maxlength="10" value="" tabindex="2"
							placeholder="请输入密码" />
					</div>
				</div>
				<div class="form-actions">
					<input type="submit" class="btn btn-primary" name="login"
						value="登录" />
				</div>
			</form>
		</div>
		<script src="<%= path %>/scripts/bootstrap.js"></script>
		<script src="<%= path %>/scripts/jquery.validate.js"></script>
		<script>
				$().ready(function() {
					$("#loginform").validate({
						errorClass: "validate-error",
						validClass: "validate-success",
						errorElement:'span',
						errorPlacement: function(error, element) {
							element.parent().parent().addClass('error');
							error.appendTo(element.parent());
						},
						success: function(label) {
							label.html('√');
							label.parent().parent().removeClass("error");
							label.parent().parent().addClass("success");
						},
						rules: {
							j_username: {
								required:true
							},
							j_password: {
								required:true
							}
						},
						messages: {
							j_username: {
							  required:'请输入用户名!'
							},
							j_password: {
							  required:'请输入密码!'
							}						
						}
					});
				});
				
		</script>
	</body>